﻿using Abp.EntityFrameworkCore;
using Batman.Jianbei.Forum.Core.Domains.Dicts;
using Batman.Jianbei.Forum.Core.Domains.Posts;
using Batman.Jianbei.Forum.Core.Domains.Pumps;
using Batman.Jianbei.Forum.Core.Domains.Socials;
using Batman.Jianbei.Forum.Core.Domains.Users;
using Microsoft.EntityFrameworkCore;

namespace Batman.Jianbei.Forum.Core.Datas
{
    public class JianbeiForumDbContext2 : AbpDbContext
    {
        public JianbeiForumDbContext2(DbContextOptions options) : base(options)
        {

        }

        public DbSet<WeixinUser> WeixinUser { get; set; }

        public DbSet<Partition> Partition { get; set; }

        public DbSet<Topic> Topic { get; set; }

        public DbSet<Post> Post { get; set; }

        public DbSet<PostImg> PostImg { get; set; }

        public DbSet<PumpSaleInfo> PumpSaleInfomation { get; set; }

        /// <summary>
        /// 胰岛素泵
        /// </summary>
        public DbSet<PumpBrand> InsulinPump { get; set; }

        /// <summary>
        /// 胰岛素泵型号
        /// </summary>
        public DbSet<PumpModel> InsulinPumpModel { get; set; }

        /// <summary>
        /// 点赞表
        /// </summary>
        public DbSet<PostTint> PostLike { get; set; }

        public DbSet<PostComment> PostComment { get; set; }

        public DbSet<Follow> Follow { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(optionsBuilder);
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<PostComment>().HasOne(t => t.WxUser).WithMany().HasForeignKey(t => t.WxUId);
        }
    }
}
